import request from "@/utils/request";

export function login(data) {
  return request({
    url: "/vue-element-admin/user/login",
    method: "post",
    data,
  });
}

export function getInfo(token) {
  return request({
    url: "/vue-element-admin/user/info",
    method: "get",
    params: { token },
  });
}

export function logout() {
  return request({
    url: "/vue-element-admin/user/logout",
    method: "post",
  });
}

// 获取用户列表
export function getUserList(params) {
  return request({
    url: "/user/list",
    method: "get",
    params,
  });
}

// 更新用户状态
export function updateUserStatus(data) {
  return request({
    url: "/user/status",
    method: "put",
    data,
  });
}

// 更新用户信息
export function updateUser(data) {
  return request({
    url: "/user/update",
    method: "put",
    data,
  });
}
